package com.jt.demo7_di;

public class Car {
    private String name;
    private String color;

    //以后写构造方法时,先写无参构造
    public Car() {
        System.out.println("我是car的无参构造!");
    }

    public Car(String name, String color) {
        this.name = name;
        this.color = color;
        System.out.println("我是car的全参构造!");
    }

    public void go() {
        System.out.println("我可以带你去任何地方!" + name + ":" + color);
    }
}
